home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-02
/
xlib.zip
/
XCOLLECT.DOC
< prev
next >
Wrap
Text File
|
1992-09-06
|
4KB
|
145 lines
XCollect
--------
This unit give some more collection objects for your Turbo-Vision
programing.
TFiFoCollection
~~~~~~~~~~~~~~~
"TFiFoCollection" is a stack build upon the TCollection object.
Can be used to build every type of stack. FiFo means first-in/
first-out.
Methods
-------
procedure Push( P : Pointer ); virtual;
Push an object to the stack
function Pop : Pointer; virtual;
Pop an object from the stack. Return nil if no more objects on
stack. Note that you must Dispose all objects you get via this
method yourself after use, because the pop function remove the
object from the stack.
function LookAHead:Pointer; virtual;
Same as Pop but only look for the object. Doesn't remove it from
the stack
TLiFoCollection
~~~~~~~~~~~~~~~
"TLiFoCollection" is a stack build upon the TCollection object.
Can be used to build every type of stack. LiFo means last-in/
first-out.
Methods
-------
procedure Push( P : Pointer ); virtual;
Push an object to the stack
function Pop : Pointer; virtual;
Pop an object from the stack. Return nil if no more objects on
stack. Note that you must Dispose all objects you get via this
method yourself after use, because the pop function remove the
object from the stack.
function LookAHead:Pointer; virtual;
Same as Pop but only look for the object. Doesn't remove it from
the stack
TIntegerItem
~~~~~~~~~~~~~
"TIntegerItem" is the object which used in the sorted "TIntegerCollection".
Only held one integer value in it.
Fields:
-------
Item : Integer The value for the object
Methods
-------
constructor Init ( AItem:Integer )
Initalize Item to AItem
TIntegerCollection
~~~~~~~~~~~~~~~~~~
"TIntegerCollection" is a sorted integer collection, based on the
"TIntegerItem". Can be used for sort integers.
Methods:
--------
function Compare(Key1, Key2: Pointer): Integer; virtual;
Compare two items against another.
function KeyOf(Item: Pointer): Pointer; virtual;
Return a pointer to a TIntegerItem
TOverflowCollection
~~~~~~~~~~~~~~~~~~~
This collection helds only some items at time. Can ideal used
for dynamic buffers like those used in terminal-programs.
Fields:
-------
MaxItems : Integer; How much items can the collection hold at time
Methods:
--------
constructor Init( ALimit,ADelta,AMax: Integer );
Initalize the collection to AMax items at time
procedure Insert( Item:Pointer ); virtual;
Insert an item to the collection. If the collection would be contain
more that MaxItems Items than the first item will be deleted
automatically.
TStrCollection
~~~~~~~~~~~~~~
Same as "TStringCollection" but unsorted. Can be used for
read in text file from resources !
TPtrCollection
~~~~~~~~~~~~~~
This collection can be used to collect other object pointers,
without dispose than after use. I use this collection for
handle a Turbo IDE like Window List. The items would be
the PWindow pointers !
TSingleCollection
~~~~~~~~~~~~~~~~~
This collection is my own aproach to build a container class.
It don't held the items as a dynamic array as TCollection,
but the collection is the object itself. With this collection
you can easy build structures like
NewMenu( .... ( NewSubMenu ( ..., nil ))));
but totally object-oriented, not procedural as TurboVision ones.
Other stuff:
~~~~~~~~~~~~
Procedure RegisterXCollect;
Register all the object in this unit